# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=corecollector
pkgver=0.3.4
pkgrel=0
pkgdesc="A coredump collector written in D"
url="https://github.com/Cogitri/corecollector"
arch="all !ppc64le !mips !mips64" # Missing gdc on these architectures
license="GPL-3.0-or-later"
depends="gdb musl-dbg"
makedepends="meson gcc-gdc scdoc"
install="$pkgname.pre-install $pkgname.pre-upgrade"
subpackages="$pkgname-doc"
source="https://github.com/Cogitri/corecollector/archive/v$pkgver/corecollector-$pkgver.tar.gz"

build() {
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=plain \
		. output
	ninja -C output
}

check() {
	ninja -C output test
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

sha512sums="2937bb9a236da5d7d7e23edd1fd1e15ad02692f338523faf527b5bc184760487b2b7494b25419f319c3741169d3df26d843d12c2999a6126a817eb20505add54  corecollector-0.3.4.tar.gz"
